package ihm;

import java.awt.Container;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JDialog;
import javax.swing.JLabel;
import javax.swing.JOptionPane;

import metier.Employe;
import metier.Velo;

import test.MenuPrincipal;

public class FenetreSupprimerVelo extends JDialog implements ActionListener
{
	private Container contenu;
	private JButton bAnnuler;
	private JButton bSupprimer;
	private JComboBox cBox;
	
	public FenetreSupprimerVelo () 
	{		
		
		cBox = new JComboBox();
		bAnnuler = new JButton("Annuler");
		bSupprimer = new JButton("Supprimer");		
		this.contenu = this.getContentPane();
		this.contenu.setLayout(null);
		
		contenu.add(bAnnuler);	
	    bAnnuler.addActionListener(this); 
	    contenu.add(bSupprimer);	
	    bSupprimer.addActionListener(this); 
	    
		bAnnuler.setBounds(400,10,100,30);
		bSupprimer.setBounds(510,10,100,30);
		cBox.setBounds(10,10,350,30);
		
		/*for(Velo unVelo : MenuPrincipal.getLesVelos())
		{
		   cBox.addItem(unVelo.toString());
		}
		contenu.add(cBox);*/
	}
	
	public void actionPerformed(ActionEvent evt)
	{
		// Bouton Annuler
		if(evt.getSource() == bAnnuler)
		{
            this.dispose();
		}	
		
		if(evt.getSource() == bSupprimer)
		{
			Velo v = (Velo)cBox.getSelectedItem();
			this.dispose();
		}
	}
}
